from django.urls import re_path, path, include
from rest_framework import routers
from . import views

router = routers.DefaultRouter()

# router.register(r"index", views.myTestViewSet, basename="00测试页面")

router.register(r"tasks", views.taskSyncfromIDViewSet, basename="01查询异步任务")


router.register(r"appLogin", views.wxappLoginViewSet, basename="09小程序登录")
router.register(r"wxCode", views.wxRequestLoginCodeV2ViewSet, basename="10公众号登录授权")
router.register(r"waitToken", views.wxRequestLoginTokenViewSet, basename="11等待本地Token")
router.register(r"swapToken", views.wxChangeLoginTokenViewSet, basename="12openid交换本地Token")
# router.register(
#     r"swapTokenApp", views.wxAppChangeLoginTokenViewSet, basename="121小程序交换本地Token"
# )

router.register(r"Userinfo", views.AllinpayWxchatListViewSet, basename="13微信个人信息")
router.register(r"Selfinfo", views.AllinpayWxchatInfoViewSet, basename="14微信个人信息(自己)")

router.register(r"wxScan", views.wxRequestLoginCodeV2ViewSet, basename="15公众号扫码登陆H5")
router.register(r"wxTask", views.wxConnectActPostViewSet, basename="16提交远程任务")
router.register(r"wyTask", views.wxConnectActListViewSet, basename="17调取远程任务")


router.register(r"hasMenu", views.WeChatSelfMenuListViewSet, basename="30读取公众号菜单")
router.register(r"setMenu", views.WeChatSelfMenuSetViewSet, basename="31设置公众号菜单")

router.register(r"License", views.AllinpayDeviceLicenseViewSet, basename="40离线项目授权")


router.register(r"beatClock", views.DjangoCeleryBeatClockedscheduleViewSet, basename="50固定时间")
router.register(r"beatCront", views.DjangoCeleryBeatCrontabscheduleViewSet, basename="51Cron时间")
router.register(r"beatInter", views.DjangoCeleryBeatIntervalscheduleViewSet, basename="52固定间隔")
router.register(r"beatTasks", views.DjangoCeleryBeatPeriodictaskViewSet, basename="53计划任务")

urlpatterns = [
    path("", include(router.urls)),
    path("wxRect/", views.wxCallback.as_view()),
    path("wxAlert/", views.wxEventAlert.as_view()),
    # path("wxAlert/<str:appid>/", views.wxEventAlert.as_view()),
    path("notify/", views.wxPayAlert.as_view()),
    path("test/", views.wxTextback.as_view()),
]
